package com.etone.smartAudit.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 存证单表
 * </p>
 *
 * @author jiayen
 * @since 2021-06-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("d_certificate_file")
@ApiModel(value = "CertificateFile对象", description = "存证单表 ")
public class CertificateFile implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 存证单类型 1-需求单，2-确认单
     */
    public static final Integer NEED_TYPE = 1;
    public static final Integer CONFIRM_TYPE = 2;


    /**
     * 存证单状态,0-处理中，1-已完成
     */
    public static final Integer STATE_HANDING = 0;
    public static final Integer STATE_COMPLETE = 1;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "intId", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "需求单名称")
    @TableField("vcName")
    private String name;

    @ApiModelProperty(value = "关联的项目id")
    @TableField("intTemId")
    private Integer itemId;

    @ApiModelProperty(value = "关联的群组id")
    @TableField("intGroupId")
    private Integer groupId;

    @ApiModelProperty(value = "开始时间")
    @TableField("dtStartTime")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("dtEndTime")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "发起人关联id")
    @TableField("intAdminId")
    private Integer adminId;

    @ApiModelProperty(value = "最后处理时间")
    @TableField("dtLastDate")
    private LocalDateTime lastDate;

    @ApiModelProperty(value = "执行人关联id")
    @TableField("intHandPersonId")
    private Integer handPersonId;

    @ApiModelProperty(value = "区块链hash地址")
    @TableField("vcHashValue")
    private String hashValue;

    @ApiModelProperty(value = "存证单类型 1-需求单，2-确认单")
    @TableField("intType")
    private Integer type;

    @ApiModelProperty(value = "被审计单位关联id")
    @TableField("intAuditPositionId")
    private Integer auditPositionId;

    @ApiModelProperty(value = "被审计单位名称 ")
    @TableField("vcAuditPosition")
    private String auditposition;


    @ApiModelProperty(value = " 被审计接口人;被审计人接口id ")
    @TableField("intAuditAdminId")
    private Integer auditadminid;

    @ApiModelProperty(value = " 是否支持扭转 0-不可扭转，1-可扭转 ")
    @TableField("intForward")
    private Integer forward;

    @ApiModelProperty(value = " 创建时间 ")
    @TableField("dtCreateTime")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "存证单分组id,记录整个单的全部流程归组 ")
    @TableField("vcFileGroupId")
    private String fileGroupId;

    @ApiModelProperty(value = "存证单版本号(针对确认单使用) ")
    @TableField("dbVersion")
    private Double version;
    //-------------------------------------------------------
    @ApiModelProperty(value = "问题依据 ")
    @TableField("vcQuestion")
    private String question;

    @ApiModelProperty(value = "内容描述 ")
    @TableField("vcContent")
    private String content;

    @ApiModelProperty(value = "审核人 ")
    @TableField("intAuditPersonId")
    private Integer auditPersonId;

    @ApiModelProperty(value = "事务所组长 ")
    @TableField("intLeaderAdminId")
    private Integer leaderAdminId;

    @ApiModelProperty(value = "质检员 ")
    @TableField("intCheckAdminId")
    private Integer checkAdminId;

    @ApiModelProperty(value = "创建人 ")
    @TableField("intCreateBy")
    private Integer createBy;

    @ApiModelProperty(value = "最后处理人id")
    @TableField("intLastHandAdminId")
    private Integer lastHandAdminId;

    @ApiModelProperty(value = "复核人员id")
    @TableField("intRecheckAdminId")
    private Integer recheckAdminId;

    @ApiModelProperty(value = "关联的事物所id")
    @TableField("intTranstraId")
    private Integer transtraId;

    @ApiModelProperty(value = "复核日期")
    @TableField("dtRecheckedTime")
    private LocalDateTime recheckedTime;

    @ApiModelProperty(value = "事项涉及专业部门")
    @TableField("vcDepart")
    private String depart;

    @ApiModelProperty(value = "存证单状态,0-处理中，1-已完成,2-待完结（处理完成，等待发起人来完结）")
    @TableField("intState")
    private Integer state;

    @ApiModelProperty(value = "审核状态，0-未审核，1-审核完成,2-审核不同意")
    @TableField("intCheckStatus")
    private Integer checkStatus;

    @ApiModelProperty(value = "执行人执行状态;需求单：1-已阅，2-同意，3-不同意 4-意见反馈，确认单： 1-【意见反馈】、2-【转派】、3-【退回】,领导【退回给部门经办人】 4-【情况属实，同意】 5-【情况不属实，请审计组核实】 -1，已撤回")
    @TableField("intHandStatus")
    private Integer handStatus;

    @ApiModelProperty(value = "执行人员id，多个是逗号隔开，执行多个发布时使用")
    @TableField("vcHandPersonIds")
    private String handPersonIds;

    @ApiModelProperty(value = "抄送人员id，多个是逗号隔开，执行多个发布时使用")
    @TableField("vcCopySendPersonInfoIds")
    private String copySendPersonInfoIds;


    @ApiModelProperty(value = "关联的附件id ,多个以逗号隔开，关联 d_project_file")
    @TableField("vcFileIds")
    private String fileIds;

    public Integer getCheckStatus() {
        return this.checkStatus == null ? 0 : this.checkStatus;
    }
}
